
// <copyright file="DynamicObjectEmptyCheckHelperTests.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   Class DynamicObjectEmptyCheckHelperTests.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Tests.Reflection
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using SubhadraSolutions.Sharp.Utils.Reflection;
    using SubhadraSolutions.Sharp.Utils.Tests.DummyClasses;

    /// <summary>
    ///     Class DynamicObjectEmptyCheckHelperTests.
    /// </summary>
    [TestClass]
    public class DynamicObjectEmptyCheckHelperTests
    {
        #region Public Methods and Operators

        /// <summary>
        ///     Tests this instance.
        /// </summary>
        [TestMethod]
        public void Test()
        {
            var e = new Employee();
            bool isEmpty = DynamicObjectEmptyCheckHelper<Employee>.IsEmpty(e);
            Assert.IsTrue(isEmpty);
            e.LastName = "Hi";
            isEmpty = DynamicObjectEmptyCheckHelper<Employee>.IsEmpty(e);
            Assert.IsFalse(isEmpty);
            e.Id = 10;
            isEmpty = DynamicObjectEmptyCheckHelper<Employee>.IsEmpty(e);
            Assert.IsFalse(isEmpty);
            e.LastName = null;
            isEmpty = DynamicObjectEmptyCheckHelper<Employee>.IsEmpty(e);
            Assert.IsFalse(isEmpty);
            e.Id = 0;
            isEmpty = DynamicObjectEmptyCheckHelper<Employee>.IsEmpty(e);
            Assert.IsTrue(isEmpty);
        }

        #endregion Public Methods and Operators
    }
}
